<?php
class Renderer {
	
	private $template_path;
	
	public function __constructor($path) {
		$this->template_path = $path;
	}
	
	public function render(View $view, LoginManager $login) {
		// smarty object 
		$model = $view->getModel();
		// load correct template			
		$template = $view->getTemplate();
		// render content
		$model->display($this->resolve("header.tpl"));
		$model->display($this->resolve("$template.tpl"));
		$model->display($this->resolve("footer.tpl"));
	}
	
	private function resolve($name) {
		return $this->template_path.$name;
	} 
}